package com.ocean.web.controller.system;

import com.ocean.common.core.controller.BaseController;
import com.ocean.common.core.domain.AjaxResult;
import com.ocean.common.core.page.TableDataInfo;
import com.ocean.system.domain.SysUrl;
import com.ocean.system.service.ISysUrlService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Controller
@RequestMapping("/system/url")
public class SysUrlController extends BaseController {

    private String prefixnc = "product/tomap";
    private String prefix = "system/url";
    @Autowired
    private ISysUrlService sysUrlService;

    @GetMapping
    public String getView(){
        return prefix + "/list";
    }

    @GetMapping("/cjdata/{pid}")
    public String cjdata(@PathVariable("pid") String pid, ModelMap mmap){
        mmap.put("pid",pid);
        return prefixnc + "/nccj";
    }
    @PostMapping("list")
    @ResponseBody
    public AjaxResult list(SysUrl sysUrl){
        List<SysUrl> list = sysUrlService.selectSysUrlList(sysUrl);
        return AjaxResult.success(list);
    }
}
